// custom-tab-bar/index.js
import {storeBindingsBehavior} from 'mobx-miniprogram-bindings'
import {store} from '../store/store'
Component({
  behaviors:[storeBindingsBehavior],
  storeBindings:{
    store,
    fields:{
      info:'info'
    },
    actions:[]
  },
  /**
   * 组件的属性列表
   */
  properties: {

  },

  /**
   * 组件的初始数据
   */
  data: {
    active: 0,
    list: [
      {
        "pagePath": "/pages/store/store",
        "text": "分类"
      },
      {
        "pagePath": "/pages/category/category",
        "text": "分类",
      },
      {
        "pagePath": "/pages/register/register",
        "text": "登录"
      }
    ]
  },

  /**
   * 组件的方法列表
   */
  methods: {
    onChange(e) {
      // console.log(e.detail,66);
      this.setData({
        active: e.detail
      })
      let index = e.detail
      let path = this.data.list[index].pagePath
      // console.log(this.data.list[index]);
      console.log(path,55);
      wx.switchTab({
        url: path,
      })
    },
  },
})
